package com.wjf.birdfish.util;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created on 2007-4-11
 * Title: 操作结束后返回页面的提示<p/>
 * Description: <p/>
 * Copyright: Copyright TYDIC (c) 2007<p/>
 * Company: tydic.com<p/>
 * @author <a href="mailto:tongys@tydic.com">童永胜</a>
 * @version 1.0
 */

public class OperateMessage {
	
	/** 定义操作类型 */
	public static final String OPERATE_TYPE_DELETE = "delete";
	public static final String OPERATE_TYPE_EDIT = "edit";
	public static final String OPERATE_TYPE_ADD = "add";
	
	
	private String message;
	private boolean isSuccess=true;
	private String errorMessage;
	private String operateUrl = "";
	private Map<String,String> map;
	
	@SuppressWarnings("unchecked")
	public OperateMessage(List<Map> url , String message,boolean isSuccess) {
		this.message = message;
		this.isSuccess = isSuccess;
		for(int i = 0 ; i < url.size() ; i++) {
			map =new HashMap<String,String>();
			map = url.get(i);
			//operateUrl += "<br/><li style='list-style:none;background:url(../images/arrowList.gif) no-repeat 2px 2px;padding:2px 5px 2px 22px;height:20px;width:160px;'><a href=" + map.get("URL" + i) +">" + map.get("TITLE" + i) + "</a></li><br />";
			//<a href="" onclick="history.back();return false;">返回上一级</a><br/>
			operateUrl+="<a style=\"color:#000000;font-size:12px;text-decoration:none; padding-left:6px;\" href=" + map.get("URL" + i) +">" + map.get("TITLE" + i) + "</a><br />";
		}	
	}
	
	public OperateMessage(String message , String errorMsg) {
		this.message = message;
		this.errorMessage = errorMsg;
	}
	
	public String getMessage() {	
		return this.message;
	}
	
	public String getOperateUrl() {
		return operateUrl;
	}

	public void setOperateUrl(String operateUrl) {
		this.operateUrl = operateUrl;
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	public boolean getIsSuccess() {
		return isSuccess;
	}

	public void setIsSuccess(boolean isSuccess) {
		this.isSuccess = isSuccess;
	}

	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}
}
